home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / global-one-water.swf / scripts / __Packages / Path.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  802 b   |  36 lines

  1. class Path extends MovieClip
  2. {
  3.    var engine;
  4.    var _positions;
  5.    var pos;
  6.    function Path()
  7.    {
  8.       super();
  9.       this._visible = false;
  10.    }
  11.    function init(e)
  12.    {
  13.       this.engine = e;
  14.       this._positions = [];
  15.       var _loc2_ = 1;
  16.       while(_loc2_ <= this._totalframes)
  17.       {
  18.          this.gotoAndStop(_loc2_);
  19.          this._positions[_loc2_] = new flash.geom.Point(this.pos._x,this.pos._y);
  20.          _loc2_ = _loc2_ + 1;
  21.       }
  22.    }
  23.    function getPositionAtFrame(n, scope)
  24.    {
  25.       var _loc2_ = this._positions[n].clone();
  26.       scope = !scope ? this.engine : scope;
  27.       this.localToGlobal(_loc2_);
  28.       scope.globalToLocal(_loc2_);
  29.       return _loc2_;
  30.    }
  31.    function get length()
  32.    {
  33.       return this._positions.length - 1;
  34.    }
  35. }
  36.